<?php

namespace App\Http\Traits;

trait ResponseJson
{
    protected function returnJson($data = [], $code = 0, $msg = "成功")
    {
        $ret = [
            "code" => $code,
            "msg"    => $msg,
            "data"   => $data ?? []
        ];
        return response()->json($ret);
    }
}
